<script>
export default{
    data(){
        return{
            msg:"hello,vue3!"
        }
    },

    beforeCreate(){
        console.log("---------beforeCreate--------------",this.msg)
    },
    created(){
        console.log("---------Created--------------",this.msg)
        setTimeout(()=>{
            this.msg="你好!"
        },1000)
    },
    beforeMount(){
        console.log("---------beforeMount--------------",this.msg)
    },
    mounted(){
        console.log("---------mounted--------------",this.msg)
    },
    beforeUpdate(){
        console.log("---------beforeUpdate--------------",this.msg)
    },
    updated(){
        console.log("---------updated--------------",this.msg)
    },
    beforeDestroy() {
        console.log("---------beforeDestroy--------------",this.msg)
    },
    destroyed() {
        console.log("---------destroyed--------------",this.msg)
    },

    methods:{//vue对象的方法
        fun1(){
            console.log("fun11111111")
        }
    }
}



</script>


<template>
    <div>
        <h1>Vue对象的生命周期</h1>
        msg:{{ msg }}
        <button @click="fun1">按钮</button>
    </div>

</template>